package com.qingke.notlonely.bean;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name="eduction")
public class Eduction {
	@Id
	@Column(name="id")
	private int id;
	@ManyToOne
	@JoinColumn(name="school_id")
	private School school;
	@ManyToOne
	@JoinColumn(name="major_id")
	private Major major;
	@ManyToOne
	@JoinColumn(name="degree_id")
	private Degree degree;
	@OneToMany(mappedBy="eduction",fetch=FetchType.LAZY)
	private Set<UserEduction> userEductions;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public School getSchool() {
		return school;
	}
	public void setSchool(School school) {
		this.school = school;
	}
	public Major getMajor() {
		return major;
	}
	public void setMajor(Major major) {
		this.major = major;
	}
	public Degree getDegree() {
		return degree;
	}
	public void setDegree(Degree degree) {
		this.degree = degree;
	}
	public Set<UserEduction> getUserEductions() {
		return userEductions;
	}
	public void setUserEductions(Set<UserEduction> userEductions) {
		this.userEductions = userEductions;
	}
	@Override
	public String toString() {
		return "Eduction [school=" + school + ", major=" + major + ", degree=" + degree + "]";
	}
	
}
